import java.io.*;
import java.util.*;

public class OStPartialSolution{
    
    Scanner in;
    PrintWriter out;
    
    boolean checkRect(int i1, int j1, int i2, int j2, boolean[][] wasPainted){
        for (int row = i1; row<=i2; row++){
            if (!wasPainted[row][j1] || !wasPainted[row][j2]){
                return false;
            }
        }
        for (int col = j1; col<=j2; col++){
            if (!wasPainted[i1][col] || !wasPainted[i2][col]){
                return false;
            }
        }
        return true;
    }
    
    void solve() {
        int nRows = in.nextInt();
        int nCols = in.nextInt();
        in.nextLine();
        boolean wasPainted[][] = new boolean[nRows][nCols];
        for (int i = 0; i < wasPainted.length; i++){
            String line = in.nextLine();
            for (int j = 0; j < wasPainted[0].length; j++){
                wasPainted[i][j] = line.charAt(j)=='*';
            }
        }
        int answer = 0;
        for (int i1 = 0; i1 < wasPainted.length; i1++){
            for (int j1 = 0; j1 < wasPainted[0].length; j1++){
                if (wasPainted[i1][j1]){
                    for (int i2 = i1+2; i2 < wasPainted.length; i2++){
                        for (int j2 = j1+2; j2 < wasPainted[0].length; j2++){
                            if (wasPainted[i2][j2] && checkRect(i1, j1, i2, j2, wasPainted)){
                                answer++;
                            }
                        }
                    }
                }
            }
        }
        out.println(answer);
	}
    
    void run() {
		in = new Scanner(System.in);
		out = new PrintWriter(System.out);
		try {
			solve();
		} finally {
			out.close();
		}
	}
    
    
    public static void main(String args[]){
        new OStPartialSolution().run();
    }
    


}
